package com.tms.springboot.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.tms.springboot.aggregation.pojo.PdAuthUser;
import com.tms.springboot.aggregation.pojo.PdDriverJob;
import com.tms.springboot.aggregation.pojo.PdTaskTransport;
import com.tms.springboot.mapper.PdAuthUserMapper;
import com.tms.springboot.search.TransportSearch;
import com.tms.springboot.service.PdAuthUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tms.springboot.view.DriverMian;
import com.tms.springboot.view.PageVo;
import com.tms.springboot.view.TransportPassage;
import com.tms.springboot.view.TransportView;
import com.tms.springboot.vo.PdAuthUserOrg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author cjj
 * @since 2023-06-14
 */
@Service
public class PdAuthUserServiceImpl extends ServiceImpl<PdAuthUserMapper, PdAuthUser> implements PdAuthUserService {

    @Autowired
    PdAuthUserMapper pdAuthUserMapper;

    //快递员管理分页查询
    @Override
    public PageInfo pdauthuserpagequerylk(PageVo<PdAuthUser> pageVo) {
        PageHelper.startPage(pageVo.getCurrentPage(),pageVo.getPageSize());
        List<PdAuthUserOrg> pdAuthUserOrgList=pdAuthUserMapper.pdauthuserpagequerylk(pageVo.getCondition());
        return new PageInfo<>(pdAuthUserOrgList);
    }

    @Override
    public DriverMian selectMainService(String id) throws Exception {
        return this.pdAuthUserMapper.selectMain(id);
    }

    @Override
    public List<PdTaskTransport> selectHistoryService(TransportSearch transportSearch) throws Exception {
        return this.pdAuthUserMapper.selectHistory(transportSearch);
    }

    @Override
    public TransportView transportfindByIdService(String id) throws Exception {
        return this.pdAuthUserMapper.transportfindById(id);
    }

    @Override
    public List<PdDriverJob> selectDrverJobStatusService(String id) throws Exception {
        return this.pdAuthUserMapper.selectDrverJobStatus(id);
    }

    @Override
    public TransportPassage selectPassageService(String id) throws Exception {
        return this.pdAuthUserMapper.selectPassage(id);
    }

    @Override
    public List<PdDriverJob> selectDeliveryService(String id) throws Exception {
        return this.pdAuthUserMapper.selectDelivery(id);
    }
}
